<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>首页</title>

    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询（media queries）功能 -->
    <!-- 警告：通过 file:// 协议（就是直接将 html 页面拖拽到浏览器中）访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->
    <!--引入三方字体图片库-->
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <style>
        body{background-color: #2e2e2e}
        .navbar{
            background-color: black;
            border: 0;/*去掉自带边框*/
            margin-top: 10px;
        }
        .navbar-brand>img{
            position: relative;
            bottom: 10px;
        }
        form>input{
            background-color: #383838;
            height: 30px;
            border-radius: 30px;
            border:0;
            margin-top:10px;
            padding:10px 20px;
            color: #a8a8a8;
            outline: none; /*去掉外边框*/
        }
        form>button{
            background-color: rgba(0,0,0,0);
            color: #a8a8a8;
            border: 0;
            position: relative;
            right: 40px;
        }
        /*超链接悬停颜色*/
        .navbar-default .navbar-nav>li>a:hover{
            color: #ffc600;
        }
        /*瀑布流相关样式*/
        .grid-item{
            width: 200px;/*瀑布流中每个元素的宽度为200*/
            margin: 0 10px 10px 0;
        }
        /*右侧边栏相关样式*/
        .list-group-item{
            border: 0;
            background-color: black;
            color: #ffc600;
        }
        .head-item{
            background-color: #ffc600;
            color: black;
        }
        .well{
            color: #ffc600;
            background-color: black;
            border: 0;
            font-weight: bold;
            text-align: center;
        }
    </style>
</head>
<body>
<header class="container">
    <!--导航条开始-->
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="#">
                    <img alt="Brand" src="images/logo.png">
                </a>
            </div>
            <!--分类开始-->
            <ul class="nav navbar-nav">
                <li><a href="">首页</a></li>
                <li v-for="category in c_arr"><a href="">{{category.name}}</a></li>
                <li>
                    <form action="">
                        <input type="text" placeholder="Search">
                        <button>
                            <i class="fa fa-search"></i>
                        </button>
                    </form>
                </li>
            </ul>
            <!--分类结束-->
            <ul class="nav navbar-nav navbar-right">
                <li v-if="!isLogin"><a href="/login.html">管理员入口</a></li>
                <li v-if="isLogin"><a href="/admin.html">后台管理页面</a></li>
            </ul>
        </div>
    </nav>
    <!--导航条结束-->
</header>
<section class="container">
    <!--轮播图开始-->
    <div id="myCarousel" class="carousel slide">
        <!-- 轮播（Carousel）指标 -->
        <ol class="carousel-indicators">
            <li v-for="(b,i) in b_arr" data-target="#myCarousel" :data-slide-to="i" :class="i==0?'active':''"></li>
        </ol>
        <!-- 轮播（Carousel）项目 -->
        <div class="carousel-inner">
            <!--(banner,i)banner代表遍历的对象,i代表遍历的下标-->
            <div v-for="(banner,i) in b_arr" class="item" :class="i==0?'active':''">
                <img :src="banner.url" alt="Second slide">
                <div class="carousel-caption"></div>
            </div>
        </div>
        <!-- 轮播（Carousel）导航 -->
        <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
        </a>
    </div>
    <!--轮播图结束-->
    <!--通过栅格系统划分3:1的两部分-->
    <div class="row">
        <div class="col-md-9">
            <!--瀑布流开始-->
            <div class="grid">
                <div class="grid-item">
                    <img src="images/a.jpg" class="img-responsive" alt="">
                </div>
                <div class="grid-item">
                    <img src="images/b.jpg" class="img-responsive" alt="">
                </div>
                <div class="grid-item">
                    <img src="images/c.jpg" class="img-responsive" alt="">
                </div>
                <div class="grid-item">
                    <img src="images/d.jpg" class="img-responsive" alt="">
                </div>
                <div class="grid-item">
                    <img src="images/e.jpg" class="img-responsive" alt="">
                </div>
                <div class="grid-item">
                    <img src="images/a.jpg" class="img-responsive" alt="">
                </div>
                <div class="grid-item">
                    <img src="images/b.jpg" class="img-responsive" alt="">
                </div>
                <div class="grid-item">
                    <img src="images/c.jpg" class="img-responsive" alt="">
                </div>
                <div class="grid-item">
                    <img src="images/d.jpg" class="img-responsive" alt="">
                </div>
                <div class="grid-item">
                    <img src="images/e.jpg" class="img-responsive" alt="">
                </div>
                <div class="grid-item">
                    <img src="images/a.jpg" class="img-responsive" alt="">
                </div>
                <div class="grid-item">
                    <img src="images/b.jpg" class="img-responsive" alt="">
                </div>
            </div>
            <!--瀑布流结束-->
        </div>
        <div class="col-md-3">
            <!--列表组开始-->
            <ul class="list-group">
                <li class="list-group-item head-item">
                    <h4>
                        <i class="fa fa-thumbs-o-up">最受欢迎</i>
                    </h4>
                </li>
                <li class="list-group-item">
                    <div class="media">
                        <div class="media-left">
                            <a href="#">
                                <img class="media-object" src="images/c.jpg"
                                    style="width: 50px;height: 40px" alt="...">
                            </a>
                        </div>
                        <div class="media-body">
                            <h4 class="media-heading">标题</h4>
                            作品介绍
                        </div>
                    </div>
                </li>
                <li class="list-group-item">
                    <div class="media">
                        <div class="media-left">
                            <a href="#">
                                <img class="media-object" src="images/c.jpg"
                                     style="width: 50px;height: 40px" alt="...">
                            </a>
                        </div>
                        <div class="media-body">
                            <h4 class="media-heading">标题</h4>
                            作品介绍
                        </div>
                    </div>
                </li>
                <li class="list-group-item">
                    <div class="media">
                        <div class="media-left">
                            <a href="#">
                                <img class="media-object" src="images/c.jpg"
                                     style="width: 50px;height: 40px" alt="...">
                            </a>
                        </div>
                        <div class="media-body">
                            <h4 class="media-heading">标题</h4>
                            作品介绍
                        </div>
                    </div>
                </li>
                <li class="list-group-item">
                    <div class="media">
                        <div class="media-left">
                            <a href="#">
                                <img class="media-object" src="images/c.jpg"
                                     style="width: 50px;height: 40px" alt="...">
                            </a>
                        </div>
                        <div class="media-body">
                            <h4 class="media-heading">标题</h4>
                            作品介绍
                        </div>
                    </div>
                </li>
            </ul>
            <!--列表组结束-->
            <!--列表组开始-->
            <ul class="list-group">
                <li class="list-group-item head-item">
                    <h4>
                        <i class="fa fa-eye">浏览最多</i>
                    </h4>
                </li>
                <li class="list-group-item">
                    <div class="media">
                        <div class="media-left">
                            <a href="#">
                                <img class="media-object" src="images/c.jpg"
                                     style="width: 50px;height: 40px" alt="...">
                            </a>
                        </div>
                        <div class="media-body">
                            <h4 class="media-heading">标题</h4>
                            作品介绍
                        </div>
                    </div>
                </li>
                <li class="list-group-item">
                    <div class="media">
                        <div class="media-left">
                            <a href="#">
                                <img class="media-object" src="images/c.jpg"
                                     style="width: 50px;height: 40px" alt="...">
                            </a>
                        </div>
                        <div class="media-body">
                            <h4 class="media-heading">标题</h4>
                            作品介绍
                        </div>
                    </div>
                </li>
                <li class="list-group-item">
                    <div class="media">
                        <div class="media-left">
                            <a href="#">
                                <img class="media-object" src="images/c.jpg"
                                     style="width: 50px;height: 40px" alt="...">
                            </a>
                        </div>
                        <div class="media-body">
                            <h4 class="media-heading">标题</h4>
                            作品介绍
                        </div>
                    </div>
                </li>
                <li class="list-group-item">
                    <div class="media">
                        <div class="media-left">
                            <a href="#">
                                <img class="media-object" src="images/c.jpg"
                                     style="width: 50px;height: 40px" alt="...">
                            </a>
                        </div>
                        <div class="media-body">
                            <h4 class="media-heading">标题</h4>
                            作品介绍
                        </div>
                    </div>
                </li>
            </ul>
            <!--列表组结束-->

        </div>
    </div>
</section>
<footer class="container">
    <div class="well">Copyright © 北京达内金桥科技有限公司版权所有 京ICP备12003709号-3 </div>
</footer>

<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
<!--引入和瀑布流相关的js文件-->
<script src="js/masonry.pkgd.min.js"></script>
<script src="js/imagesloaded.pkgd.js"></script>
<!--引入vue-->
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<!--引入axios框架-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script src="js/header.js"></script>
<script src="js/banner.js"></script>
<script>
    //让轮播图 开始移动
    $("#myCarousel").carousel("cycle");

    //对瀑布流做初始化操作
    $(".grid").masonry({
        itemSelector:".grid-item",//告诉瀑布流框架如何找到页面中的瀑布流里面的元素
        columnWidth:210 //设置每一列的宽度(图片200+10间距)
    })
    //解决图片层叠问题
    //通过图片加载完事件 解决此问题, 加载完之后让瀑布流重新计算布局
    $(".grid").imagesLoaded().progress(function () {
        //图片加载完之后会调用此处代码
        $(".grid").masonry("layout");//让瀑布流框架重新计算元素的位置
    })

</script>
</body>
</html>